package com.thoughtworks.jspecsupport;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class StringUtilTest {

    @Test
    public void should_filter_color_chars() {
        String source = "Passes: \u001B[0m\u001B[32m1\u001B[0m\u001B[1m Failures: \u001B[0m\u001B[31m2\u001B[0m\u001B[1m Duration: \u001B[0m\u001B[32m393\u001B[0m ms";
        String filterd = StringUtil.filterColor(source);
        assertEquals("Passes: 1 Failures: 2 Duration: 393 ms", filterd);
    }
}
